package gjtx8;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class Encryption {
    public static void main(String[] args) {
        File f=new File("D:\\新建文件夹\\java10\\13.txt");
        File f1=new File("D:\\新建文件夹\\java10\\14.txt");
        try {
            FileInputStream fs=new FileInputStream(f);
            FileOutputStream fo=new FileOutputStream(f1,true);
            //byte[] b=new byte[1];
            int i=0;
            while ((i=fs.read())!=-1){
                int k=~i;
                System.out.println(k);
                fo.write(k);
            }
            fs.close();
            fo.close();
             f.delete();
            f1.renameTo((f));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
